package DataStructrue.list;



public interface MyList<E>{
    
    int size();
    
    boolean isEmpty();

    boolean contains(E element);
    
    boolean add(E element);

    void add(int index, E element);
    
    boolean remove(E element);

    E remove(int index);
    
    E get(int index);
    
    int indexOf(E element);

    E set(int index, E element);
    
    void clear();


//SeqList{e=[10,11,12,13,14,15,16,17,18,19], size=10}
//SeqList{e=[10,11,12,13,14,109,108,107,106,105,104,103,102,101,100,15,16,17,18,19], size=20}
//SeqList{e=[11,13,109,107,105,104,103,102,101,100,15,16,17,18,19], size=15}
//SeqList{e=[11,13,109,107,105,15,16,17,18,19], size=10}
//SeqList{e=[], size=0}

    public static void main(String[] args) {
        MyList<Integer> l=new SeqList<>();
        for (int i = 0; i < 10; i++) {
            l.add(i+10);
        }
        System.out.println(l);
        for (int i = 0; i < 10; i++) {
            l.add(5,i+100);
        }
        System.out.println(l);
        for (int i = 0; i < 5; i++) {
            l.remove(i);
        }
        System.out.println(l);
        for (int i = 0; i < 5; i++) {
            l.remove(new Integer(i+100));
        }
        System.out.println(l);
        for (int i = 0; i < 20; i++) {
            l.remove(l.size()-1);
        }
        System.out.println(l);
    }
}
